﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;
using Angel.Entities;
using PagedList;

namespace Angel.Web.Models
{
    public class AddModel
    {
        [Required]
        [Display(Name = "User name")]
        public string UserName { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Current password")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm new password")]
        [Compare("Password", ErrorMessage = "The new password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }

        [Required]
        [Display(Name = "Full Name")]
        public String fullName { get; set; }

        [Required]
        [DataType(DataType.EmailAddress)]
        [RegularExpression(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", ErrorMessage = "Invalid format email")]
        [Display(Name = "Email address")]
        public string Email { get; set; }

        [Display(Name = "Send Notification Email?")]
        public bool sendNotify { get; set; }
    }

    public class FilterModel
    {
        public String userNameContain { get; set; }
        public String fullNameContain { get; set; }
        public String emailContain { get; set; }
        public int groupId { get; set; }
        public List<FilterUser> list { get; set; }
 
    }

    public class EditUserModel
    {
        [Required]
        public int Id { get; set; }
        [Required]
        [Display(Name = "Full Name")]
        public string FullName { get; set; }

        [Required]
        [DataType(DataType.EmailAddress)]
        [RegularExpression(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", ErrorMessage = "Invalid format email")]
        [Display(Name = "Email address")]
        public string Email { get; set; }
    }
    public class DeleteUserModel
    {
        [Required]
        [Display(Name = "Id of username")]
        public long Id { get; set; }

        [Required]
        [Display(Name = "Username")]
        public string username { get; set; }
    }
    public class FilterUser
    {
        public int UserID { set; get; }
        public String UserName { get; set; }
        public String FullName { get; set; }
        public String Email { get; set; }
        public String LoginDetails { get; set; }
        public int GroupId{get;set;}
        public List<Group> Groups { get; set; }
        public String Directory { get; set; }
    }
}